let {login,admin} = require('../methods/user.js');
let {getFarmList} = require('../methods/farm1.js');
let checkLogin = require('../middleware/checkLogin.js');
let authMiddleware = require('../middleware/authMiddleware.js');

module.exports = [
  /*
  * 生成验证码接口
  * */
  {
    url: '/login',
    method: 'post',
    callback: login
  },
  {
    url: '/admin', // 只向让管理员得到结果  别人 无权限
    method: 'GET',
    callback: [checkLogin(),authMiddleware(['admin_view']),admin]
  },
  {
    url:'/getFarmList',
    method:'GET',
    callback:getFarmList
  }
];

